package com.fangzhen.service.impl;

import com.fangzhen.common.OperateEnum;
import com.fangzhen.mapper.UserMapper;
import com.fangzhen.pojo.User;
import com.fangzhen.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 用户服务层实现
 *
 * @author : z_sz
 * @date : 2020-09-09
 **/
@Service
public class UserServiceImpl implements UserService {

    /**
     * 用户持久层对象
     */
    @Resource
    private UserMapper userMapper;

    @Override
    public OperateEnum saveUser(User user) {
        userMapper.saveUser(user);
        return OperateEnum.INSERT_SUCCESS;
    }

    @Override
    public User queryUser(Long id) {
        return userMapper.queryUser(id);
    }
}
